package com.clarence.dada.modular.system.menu.entity.req;

import com.clarence.dada.core.base.BaseReq;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Set;

/**
 * 系统菜单按钮请求参数
 *
 * @author GD
 * @since  2021/1/9 11:19
 */
@Data
@Schema(title = "系统菜单按钮请求实例")
@EqualsAndHashCode(callSuper = true)
public class SysMenuButtonReq extends BaseReq {

    /**
     * 主键
     */
    @NotNull(message = "按钮主键不能为空", groups = {edit.class, detail.class, delete.class})
    @Schema(title = "主键", example = "1")
    private Long buttonId;

    /**
     * 菜单按钮主键集合
     */
    @NotEmpty(message = "菜单按钮主键集合不能为空", groups = {batchDelete.class})
    @Schema(title = "菜单按钮主键集合", example = "1,2,3")
    private Set<Long> buttonIds;

    /**
     * 菜单id，按钮需要挂在菜单下
     */
    @NotNull(message = "菜单id不能为空", groups = {add.class, edit.class, list.class, defaultButtons.class})
    @Schema(title = "菜单id，按钮需要挂在菜单下", example = "1")
    private Long menuId;

    /**
     * 按钮的名称
     */
    @NotBlank(message = "按钮名称不能为空", groups = {add.class, edit.class})
    @Schema(title = "按钮的名称", example = "增加")
    private String buttonName;

    /**
     * 按钮的编码
     */
    @NotBlank(message = "按钮编码不能为空", groups = {add.class, edit.class})
    @Schema(title = "按钮的编码", example = "add")
    private String buttonCode;

    /**
     * 批量删除验证分组
     */
    public @interface batchDelete {

    }

    /**
     * 一键添加系统默认按钮
     */
    public @interface defaultButtons {

    }

}
